//package com.atguigu.juc.threadlocal;
//
//import com.alibaba.fastjson2.JSON;
//
//import java.lang.ref.WeakReference;
//
///**
// * @Description:
// * @author： yeswater
// * @create： 2024/5/30
// */
//
//public class ThreadLocalDemo {
//	
//	public static void main(String[] args) {
//		ThreadLocal<Integer> threadLocal = ThreadLocal.withInitial(() -> 0);
//		System.out.println(thzreadLocal.get());
//		System.out.println(JSON.toJSONString(threadLocal));
//		
//		// obj => str 谁是谁的弱引用？？？ GC时删除被引用的对象
//		WeakReference<String> obj = new WeakReference<>("obj");
//		
//		// entry => threadLocal GC时 threadLocal 会被删除
//		WeakReference<ThreadLocal> entry = new WeakReference<>(threadLocal);
//		
//		ThreadLocal<Object> threadLocal1 = new ThreadLocal<>();
//		threadLocal1.set(obj);
//	}
//	
//}
